﻿#ifndef CFTPSERVER_H
#define CFTPSERVER_H

#include <QWidget>
#include <QTcpSocket>
#include <QTcpServer>
#include <QList>
#include "CServerThread.h"

namespace Ui {
class CFtpServer;
}

class CFtpServer : public QWidget
{
    Q_OBJECT

public:
    explicit CFtpServer(QWidget *parent = nullptr);
    ~CFtpServer();

    void stopAllThread();

private slots:
    void slot_NewConnection();

    void on_startButton_clicked();
    void on_dirButton_clicked();

private:
    Ui::CFtpServer *ui;

    SServerConfig  m_sServerConfig;
    QString        m_strWorkDir = "";
    bool           bConnected = false;

    int                m_iMaxClient;
    int                m_iCurClient = 0;
    QTcpServer*        m_pTcpServer = nullptr;

    QVector<CServerThread*>  m_vecSubServerThread;
};

#endif // CFTPSERVER_H
